app.service('chainGoodsDetailInfoService',['$q','utilService',function($q,utilService){

    var _this_=this;

    _this_.findByIdForOther=function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain+"goods/other/"+$scope.id
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }

    _this_.findByGoodsId=function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'goods/images/goodsid/'+$scope.id,
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }

    //查询skuitem
    _this_.queryGoodsSku=function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'goodssku/skuitems/bo/'+$scope.id,
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }

    //查询skucontent
    _this_.querySkuContent=function($scope){
        var deferred = $q.defer();
        utilService.get({
            url:$scope.app.domain + 'goodssku/skucontent/'+$scope.id,
        }).then(function(response){
            deferred.resolve(response.data);
        },function(e){
            console.error(e);
            deferred.reject("连接服务器出错！");
        })
        return deferred.promise;
    }


}])